
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>SpringBoot自动装配 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>SpringBoot自动装配 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">SpringBoot自动装配原理主要依赖于哪几个核心组件？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">SpringBoot的自动装配主要基于四个核心组件：1. Spring Boot Starter（预定义依赖包）；2. 条件注解（如@ConditionalOnClass，用于定义装配条件）；3. 自动装配原理（通过扫描META-INF/spring.factories文件加载装配类）；4. Spring Boot Auto-Configuration模块（实现自动装配的核心）。</div>
          </div>
          <div class="card-source">来源: 文档开头的核心组件列表</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">SpringBoot是如何发现并加载所有需要自动装配的类的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在项目启动时，SpringBoot会扫描类路径下的`META-INF/spring.factories`文件，并加载其中定义的所有自动装配类。然后，根据条件注解判断是否满足装配条件，如果满足，则将相应的组件注册到Spring容器中。</div>
          </div>
          <div class="card-source">来源: 文档开头的核心组件列表 - 自动装配原理部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">Spring Boot Starter在自动装配中扮演什么角色？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Spring Boot Starter是一系列预定义的依赖包。当开发者在项目中引入一个Starter时，它会自动导入一系列与特定功能相关的依赖项，从而使得开发者无需手动逐一配置这些依赖。</div>
          </div>
          <div class="card-source">来源: 文档开头的核心组件列表 - Spring Boot Starter部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">@SpringBootApplication注解实际上是哪三个核心注解的组合？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">@SpringBootApplication注解是由@SpringBootConfiguration、@EnableAutoConfiguration和@ComponentScan三个注解组合而成的。</div>
          </div>
          <div class="card-source">来源: 文档中「自动转配原理」章节</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在自动装配过程中，@EnableAutoConfiguration注解是如何发挥作用的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">@EnableAutoConfiguration注解通过导入EnableAutoConfigurationImportSelector，使其能够扫描classpath下所有的spring.factories文件，从而找到并加载配置的自动装配类，实现Bean的自动化配置。</div>
          </div>
          <div class="card-source">来源: 文档中「自动转配原理」章节</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在`spring.factories`文件中，自动装配类是配置在哪个特定的键（key）下面的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在`spring.factories`文件中，所有自动装配的配置类都作为值被列在`org.springframework.boot.autoconfigure.EnableAutoConfiguration`这个键（key）下面。</div>
          </div>
          <div class="card-source">来源: 文档中「自动转配原理」章节</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">条件注解（例如@ConditionalOnProperty）在自动装配中的具体作用是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">条件注解用于定义自动装配的触发条件。Spring Boot会根据这些条件注解来判断是否满足某些条件（如类路径上是否存在某个类，或配置文件中是否有某个属性），只有在满足条件时，相应的组件才会被自动装配。</div>
          </div>
          <div class="card-source">来源: 文档开头的核心组件列表 - 条件注解部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">SpringBoot自动配置的根本依据是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">SpringBoot自动配置的根本依据是应用程序的类路径（classpath）。它会根据类路径中存在的jar包和类，来自动地为你生成一些Bean，并加载到Spring的Context中，从而极大减少手动配置的数量。</div>
          </div>
          <div class="card-source">来源: 文档中「自动转配原理」章节</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">实现自动装配的核心模块是什么？它包含了什么内容？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">实现自动装配的核心模块是Spring Boot的Auto-Configuration模块。该模块包含了大量的@Configuration类，这些类通过条件注解来决定是否需要自动配置相应的组件。</div>
          </div>
          <div class="card-source">来源: 文档开头的核心组件列表 - Spring Boot Auto-Configuration模块部分</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
